//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package 力扣.题库.未分类.demo1AND20;

public class demo7 {
    public demo7() {
    }

    public static void main(String[] args) {
        System.out.println(reverse1(989));
    }

    public static int reverse1(int x) {
        if (x == 0) {
            return 0;
        } else if (x > 0) {
            long y;
            for(y = 0L; x > 0; x /= 10) {
                y = y * 10L + (long)(x % 10);
            }

            return !((double)y < -Math.pow((double)2.0F, (double)31.0F)) && !((double)y > Math.pow((double)2.0F, (double)31.0F) - (double)1.0F) ? (int)y : 0;
        } else {
            x = -x;

            long y;
            for(y = 0L; x > 0; x /= 10) {
                y = y * 10L + (long)(x % 10);
            }

            return !((double)y < -Math.pow((double)2.0F, (double)31.0F)) && !((double)y > Math.pow((double)2.0F, (double)31.0F) - (double)1.0F) ? -((int)y) : 0;
        }
    }
}
